<div>
<input type="hidden"  name="filterMap['${field.name}${listQueryField.orderNumber}'].filterName" value="${field.name}" />
<input type="hidden"  name="filterMap['${field.name}${listQueryField.orderNumber}'].expType" value="in" />
<input type="hidden"  name="filterMap['${field.name}${listQueryField.orderNumber}'].formatter" value="StringInFormatter" />
<input type="hidden"  name="filterMap['${field.name}${listQueryField.orderNumber}'].fieldId" value="${field.id}" />
</div>
<div id="DropdownMenu${listQueryField.orderNumber}" class="dropDD_contentDiv">
	<div style="overflow:auto;height:266px">
		<#if value_list??>
		<table id="${field.name}Table" border="0" cellspacing="0" cellpadding="0">
		<#assign index=1>
		<#list value_list as obj>
			<#if index==1>
				<tr>
			</#if>
			<td>
			<label style="cursor:pointer;"><input type="checkbox"  ${"<#if"} filterMap["${field.name}${listQueryField.orderNumber}"]${"?? &&"} filterMap["${field.name}${listQueryField.orderNumber}"].filterValue${"?? &&"} filterMap["${field.name}${listQueryField.orderNumber}"].filterValue=="${obj.value}"> checked="checked" ${"<#else>"} ${"<#if"} !filterMap["${field.name}${listQueryField.orderNumber}"]${"?? ||"} !filterMap["${field.name}${listQueryField.orderNumber}"].filterValue${"??"}> <#if listQueryField?? && listQueryField.defaultValue?? && listQueryField.defaultValue==obj.value>checked="checked"</#if>${"</#if>"}${"</#if>"}  value="${obj.value?default('')}"/>&nbsp;${obj.name}</label>&nbsp;&nbsp;
			</td>
			<#if index==2>
				</tr>
				<#assign index=0>
			<#else>
				<#if index==value_list?size>
				</tr>
				</#if>
			</#if>
			<#assign index=index+1>
		</#list>
		</table>
		</#if>
	</div>
	<div class="buttonBox" style="position:absolute;bottom:0px;background:#f3f4f4;height:30px;padding-top:4px">
		<a href="javascript:void(0);" class="button" tabindex="-1"><input type="button" onclick="window.curDDWin.saveWin();return false;" value="确认"></a>
		<a href="javascript:void(0);" class="button" tabindex="-1"><input type="button" onclick="clearCheckbox${listQueryField.orderNumber}();return false;" value="清空"></a>
	</div>
</div>


<#if listQueryField?? && listQueryField.hidden?? && listQueryField.hidden=="1">
<input type="hidden" name="filterMap['${field.name}${listQueryField.orderNumber}'].filterValue" ${"<#if filterMap["}"${field.name}${listQueryField.orderNumber}"${"]?? && filterMap["}"${field.name}${listQueryField.orderNumber}"${"].filterValue??>"} value='${"${"}filterMap["${field.name}${listQueryField.orderNumber}"].filterValue${"}"}' ${"<#else>"}value='${listQueryField.defaultValue?default('')}'${"</#if>"} id="${field.name}Id" />
<#else>
<input type="text" readonly="readonly" class="textTest text_width_100px" name="filterMap['${field.name}${listQueryField.orderNumber}'].filterValue" ${"<#if filterMap["}"${field.name}${listQueryField.orderNumber}"${"]?? && filterMap["}"${field.name}${listQueryField.orderNumber}"${"].filterValue??>"} value='${"${"}filterMap["${field.name}${listQueryField.orderNumber}"].filterValue${"}"}' ${"<#else>"}value='${listQueryField.defaultValue?default('')}'${"</#if>"} id="${field.name}Id" />
</#if>



<script language="JavaScript">
$(function(){
	$('input[type="checkbox"]',document.getElementById('DropdownMenu${listQueryField.orderNumber}')).change(function(){
		var value = '';
		$('input[type="checkbox"]',document.getElementById('DropdownMenu${listQueryField.orderNumber}')).each(function(){
			if($.browser.msie&&($.browser.version == "6.0" || $.browser.version == "7.0")){
				if(this.checked){
					value += (this.value+',');
				}
			} else {
				if($(this)[0].checked){
					value += (this.value+',');
				}
			}
		});
		if(value!='') {
			value = value.substring(0,value.length-1);
		}
		document.getElementById('${field.name}Id').value = value;
	});
	var value = $(document.getElementById('${field.name}Id')).val();
	if(value!='') {
		$('input[type="checkbox"]',document.getElementById('${field.name}Table')).each(function(){
			var thisValue = $(this).val();
			if(value==thisValue || value.indexOf(thisValue+',') == 0 || value.indexOf(','+thisValue+',') >= 0 || (value.indexOf(','+thisValue)>-1 && (value.indexOf(','+thisValue) + thisValue.length+1+'' == value.length))) {
				if($(this).get(0)) $(this).get(0).checked="checked";
				this.checked = "checked";
			}
		});
	}
});


function controller${listQueryField.orderNumber}(){
	 $(document.getElementById('${field.name}Id')).inputStyle({
		operatorId:"companyMenuBtn${listQueryField.orderNumber}",
		operatorType:"text",
		operatorText:"选择",
		controllerWidth:120,
		operatorFun:showMenu${listQueryField.orderNumber},
		imgFun:clearCheckbox${listQueryField.orderNumber}
	});
}
addLoadEvent(controller${listQueryField.orderNumber});

//show window
function showMenu${listQueryField.orderNumber}()
{
	new DDWin({
		el:"DropdownMenu${listQueryField.orderNumber}"
		,dep:'${field.name}Id'
		,clickBody:'save'
	});
}

//clean value
function clearCheckbox${listQueryField.orderNumber}(){
	$('input[type="checkbox"]',document.getElementById('DropdownMenu${listQueryField.orderNumber}')).each(function(){
		this.checked = "";
		$(this)[0].checked = "";
	});
	$(document.getElementById('${field.name}Id')).val("");
	window.curDDWin.saveWin();
}
</script>